//    Copyright (C) Kherty.  All rights reserved.
using System.Collections.Generic;

namespace OpenLS.Spreadsheet
{
    class CellAddressComparer: IEqualityComparer<CellAddress>
    {
        #region IEqualityComparer<CellAddress> Members

        public bool Equals(CellAddress x, CellAddress y)
        {
            return x.Row == y.Row && x.Column == y.Column;
        }

        public int GetHashCode(CellAddress obj)
        {
            return ((obj.Column + 1) << 16) + obj.Row;
            //\\return obj.GetHashCode();
        }
        public static int GetHashCodeOf(CellAddress obj)
        {
            return ((obj.Column + 1) << 16) + obj.Row;
        }

        #endregion
    }
}
